Repository navigation
otel 수신 데이터 90일 지나면 Vercel Blob 으로 이관하는 Cron - #53
Merged
Merged
Conversation
/api/cron/otel-retention 이 otel_log_record 와 otel_raw_batch 에서 received_at 이 보관 기간보다 오래된 행을 5000건씩 지운다. 기간은 OTEL_RETENTION_DAYS(기본 90, 최소 7). Vercel Cron 이 매일 19:00 UTC(04:00 KST)에 부르고 CRON_SECRET 으로 요청을 확인한다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GbwQAmvPRPEB5MErYrrUqn
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
proofer-otel-archive(private Blob 스토어)에 테넌트/날짜별 gzip NDJSON 으로 올리고, 올라간 묶음의 행만 DB 에서 뺀다. 업로드가 실패하면 그 묶음은 남겨 두어 다음 실행에서 다시 옮긴다. 파일 이름이 행 id 범위라 재시도해도 같은 파일을 덮어쓴다. private 업로드를 위해 @vercel/blob 을 0.22.3 에서 2.9.0 으로 올린다. 기존 사용처 scripts/blog/cli.ts 는 그대로 타입체크를 통과한다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GbwQAmvPRPEB5MErYrrUqn
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
무엇을
otel.proofer.tech 수신 데이터가 Neon 에 계속 쌓이는 것을 막되, 지우지 않고 Vercel Blob 으로 옮긴다.
GET /api/cron/otel-retention:otel_log_record,otel_raw_batch에서received_at이 보관 기간보다 오래된 행을 5000건씩 읽어proofer-otel-archive(private Blob 스토어, icn1)에 올린다otel/{tenant}/{yyyy}/{mm}/{dd}/{table}-{첫 id}-{끝 id}.ndjson.gzOTEL_RETENTION_DAYS(기본 90, 7 미만이면 기본값)vercel.jsoncron: 매일0 19 * * *(04:00 KST)CRON_SECRET. 스토어 토큰은OTEL_ARCHIVE_READ_WRITE_TOKEN(스토어를 프로젝트에 연결하며 생성, 기존represent-blob의BLOB_READ_WRITE_TOKEN과 분리)@vercel/blob0.22.3 -> 2.9.0. 기존 사용처scripts/blog/cli.ts는 타입체크 통과/api경로는 proxy 의 서브도메인 rewrite 와 점검 모드를 타지 않아 Cron 이 그대로 닿는다검증
tsc --noEmit, eslint, jest 153건 통과rows: 0이 정상이고, 첫 실제 이관은 2027-02 중순https://claude.ai/code/session_01GbwQAmvPRPEB5MErYrrUqn
Generated by Claude Code